<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
	xmlns:h="http://xmlns.jcp.org/jsf/html"
	xmlns:f="http://xmlns.jcp.org/jsf/core"
	xmlns:jsf="http://xmlns.jcp.org/jsf"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich">

<ui:composition template="/WEB-INF/templates/defaultLayout.xhtml">

	<!-- Definiendo la cabecera de la pagina -->
	<ui:define name="title">
		<h:outputText value="Boveda" />
	</ui:define>

	<!-- Definiendo el cuerpo de la pagina -->
	<ui:define name="content">
		<h:form id="formTransaccion">
			<br />
			<div style="margin-left: 50px;">
				<div>
					<div>
						<div class="p6n-api-consent-screen-title">Caja COMPRA/VENTA</div>
						<rich:messages id="messages"></rich:messages>
						<div class="p6n-api-consent-screen-inputs">
							<div class="p6n-api-consent-screen-input-section">
								<div class="p6n-api-consent-screen-label" style="width: 150px;">TIPO
									TRANSACCION</div>
								<div>
									<h:selectOneMenu
										value="#{transaccionCompraVentaCajaBean.comboTipotransaccion.itemSelected}"
										valueChangeListener="#{transaccionCompraVentaCajaBean.changeTipotransaccion}"
										required="true"
										requiredMessage="Seleccione un Tipo de Transaccion">
										<f:selectItem itemLabel="--Seleccione--" itemValue="" />
										<f:selectItems
											value="#{transaccionCompraVentaCajaBean.comboTipotransaccion.items.entrySet()}"
											var="val" itemLabel="#{val.value.denominacion}"
											itemValue="#{val.key}" />
										<a4j:ajax onbegin="$.blockUI();" oncomplete="$.unblockUI();" />
									</h:selectOneMenu>
								</div>
							</div>
							<div class="p6n-api-consent-screen-input-section">
								<div class="p6n-api-consent-screen-label" style="width: 150px;">PERSONA</div>
								<div>
									<h:inputText
										value="#{transaccionCompraVentaCajaBean.referencia}"
										style="width: 300px;" />
								</div>
							</div>
							<div class="sf-separator"></div>
							<div class="p6n-api-consent-screen-input-section">
								<div style="display: inline-block;">
									<div class="p6n-api-consent-screen-label" style="width: 150px;">MONEDA
										RECIBIDA</div>
									<div>
										<h:selectOneMenu
											value="#{transaccionCompraVentaCajaBean.comboTipomonedaRecibido.itemSelected}"
											valueChangeListener="#{transaccionCompraVentaCajaBean.changeTipomonedaRecibido}"
											required="true"
											requiredMessage="Seleccione un Tipo de Transaccion">
											<f:selectItem itemLabel="--Seleccione--" itemValue="" />
											<f:selectItems
												value="#{transaccionCompraVentaCajaBean.comboTipomonedaRecibido.items.entrySet()}"
												var="val" itemLabel="#{val.value.denominacion}"
												itemValue="#{val.key}" />
											<a4j:ajax onbegin="$.blockUI();" oncomplete="$.unblockUI();" />
										</h:selectOneMenu>
									</div>
								</div>
								<div style="display: inline-block;">
									<div class="p6n-api-consent-screen-label" style="width: 40px;"></div>
									<div></div>
								</div>
								<div style="display: inline-block;">
									<div class="p6n-api-consent-screen-label" style="width: 150px;">MONEDA
										ENTREGADA</div>
									<div>
										<div style="display: inline-block;">
											<div>
												<h:selectOneMenu
													value="#{transaccionCompraVentaCajaBean.comboTipomonedaEntregado.itemSelected}"
													valueChangeListener="#{transaccionCompraVentaCajaBean.changeTipomonedaEntregado}"
													required="true"
													requiredMessage="Seleccione un Tipo de Transaccion">
													<f:selectItem itemLabel="--Seleccione--" itemValue="" />
													<f:selectItems
														value="#{transaccionCompraVentaCajaBean.comboTipomonedaEntregado.items.entrySet()}"
														var="val" itemLabel="#{val.value.denominacion}"
														itemValue="#{val.key}" />
													<a4j:ajax onbegin="$.blockUI();"
														oncomplete="$.unblockUI();" />
												</h:selectOneMenu>
											</div>
										</div>
									</div>
								</div>
							</div>
							<div class="p6n-api-consent-screen-input-section">
								<div class="p6n-api-consent-screen-label" style="width: 150px;">TASA
									DE CAMBIO</div>
								<div>
									<h:inputText
										value="#{transaccionCompraVentaCajaBean.tasaCambio}" />
								</div>
							</div>
							<div class="p6n-api-consent-screen-input-section">
								<div style="display: inline-block;">
									<div class="p6n-api-consent-screen-label" style="width: 150px;">MONTO
										RECIBIDO</div>
									<div>
										<ul>
											<li><h:inputText id="txtMontoRecibido"
													value="#{transaccionCompraVentaCajaBean.montoRecibido}"
													required="true">
													<f:converter converterId="MonedaConverter"></f:converter>
													<f:ajax event="blur" render="@this" />
												</h:inputText></li>
											<li><h:commandButton value="Calculadora"
													styleClass="action">
													<rich:componentControl target="dlgCalculadoraRecibido"
														operation="show" />
												</h:commandButton></li>
										</ul>
									</div>
								</div>
								<div style="display: inline-block;">
									<div class="p6n-api-consent-screen-label" style="width: 40px;"></div>
									<div></div>
								</div>
								<div style="display: inline-block;">
									<div class="p6n-api-consent-screen-label" style="width: 150px;">MONTO
										ENTREGADO</div>
									<div>
										<ul>
											<li><h:inputText id="txtMontoEntregado"
													value="#{transaccionCompraVentaCajaBean.montoEntregado}"
													required="true">
													<f:converter converterId="MonedaConverter"></f:converter>
													<f:ajax event="blur" render="@this" />
												</h:inputText></li>
											<li><h:commandButton value="Calculadora"
													styleClass="action">
													<rich:componentControl target="dlgCalculadoraEntregado"
														operation="show" />
												</h:commandButton></li>
										</ul>
									</div>
								</div>
							</div>
							<div class="sf-separator"></div>
							<div class="sf-buttons" style="float: left;">
								<a4j:commandButton value="Guardar"
									action="#{transaccionCompraVentaCajaBean.createTransaccioncaja()}"
									onbegin="$.blockUI();" oncomplete="$.unblockUI();"
									styleClass="action blue">
								</a4j:commandButton>
							</div>
						</div>
					</div>
				</div>
			</div>
		</h:form>
	</ui:define>

</ui:composition>
</html>